﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LED_Editor.Controls
{
    public static class ZoomHelper
    {
        public static int InnerScale = 100;

        public static int GetMilliseconds(int x,float scaleFactor)
        {
            return (int)((double)x * 1000d * (double)InnerScale / (double)scaleFactor);
        }
        public static float GetX(int ms, float scaleFactor)
        {
            return (float)((double)ms * (double)scaleFactor / 1000d / (double)InnerScale);
        }

        public static int GetScaledWidth(int width, float scaleFactor)
        {
            return (int)(scaleFactor * width / 100 / InnerScale);
        }
        public static int GetInitialWidth(int scaledWidth, float scaleFactor)
        {
            return (int)(scaledWidth * 100 / scaleFactor * InnerScale);
        }
    }
}
